<template>
  <div class="">
    <div class="">
      <van-field
        :disabled="!edit"
        label-class="label"
        v-model="addInfo.address"
        name="施工地址"
        label="施工地址"
        placeholder="省市区某商场/商铺/写字楼,不保工厂,建筑工地"
        :rules="[
          {
            required: true,
            message: '省市区某商场/商铺/写字楼,不保工厂,建筑工地',
          },
        ]"
      />
      <span class="text-red-500 text-[15px] ml-[17px]"
        >省市区某商场/商铺/写字楼,不保工厂,建筑工地</span
      >
    </div>
  </div>
</template>
<script setup lang="ts">
import { defineProps, reactive, watchEffect, defineExpose } from "vue";

const props = defineProps({
  edit: { type: Boolean },
  addInfo: { type: Object as any },
});
const addInfo = reactive({
  address: "",
});
watchEffect(() => {
  if (props.addInfo) {
    addInfo.address = props.addInfo.address;
  }
});
defineExpose({
  addInfo,
});
</script>
